﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<List<Brjostagjof_H4.Models.UserHandling>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Brjóstagjöf.is | Notendur
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h3>Notendur</h3>
    <table id="main-table">
        <tr>

            <td id="main-table-left">
                <div class="user-edit-list-container">
                <table>
                    <tr>
                        <th>Notandi</th>
                        <th>Hlutverk</th>
                        <th>Virkur</th>                                        
                        <th>Stofnaður</th>
                    </tr>
                <% foreach (var item in Model)
                    { %>
                    <tr>
                            <td>
                            <%: Html.ActionLink(item.UserName, "EditThisUser", new { userName = item.UserName })%>
                        </td>                   
                        <td>
                            <% if (item.RoleName == "Administrators")
                                { %>Stjórnandi<% }
                                else if (item.RoleName == "Professionals")
                                { %>Fagaðili<% }
                                else
                                    { %>Foreldri<% } %>
                        </td>
                        <td>
                            <% if (item.isActive == false)
                                { %>Óvirkur<% }
                                else { %>Virkur<% } %>
                        </td>
                        <td>
                            <%: item.CreateDate %>
                        </td>
                    </tr>
                <% } %>
                </table>
                </div>
            </td>

            <td id="main-table-right">
                <div class="options">
                    <% if (User.IsInRole("Administrators")){Html.RenderPartial("~/Views/Home/ProfileAdminMenu.ascx", "Model");} %>
                    <% else if (User.IsInRole("Professionals")) { Html.RenderPartial("~/Views/Home/ProfileProMenu.ascx", "Model"); } %>
                    <% else { Html.RenderPartial("~/Views/Home/ProfileMenu.ascx", "Model"); } %>
                </div>
            </td>

        </tr>
    </table>

        

</asp:Content>
